<template>
  <div :class="{ app: true, after: isloading }">
    <loading class="loading" v-if="isloading"></loading>
    <router-view />
    <bubble></bubble>
    <!-- <div class="pio-container left">
      <div class="pio-action"></div>
      <canvas id="pio" width="230" height="275"></canvas>
    </div> -->
  </div>
</template>

<script setup lang="ts">
import { onMounted, getCurrentInstance } from 'vue';
// console.log(getCurrentInstance()?.appContext.app.config.globalProperties.$loading.value, 555555)
//显示或隐藏加载页面
const isloading = getCurrentInstance()?.appContext.app.config.globalProperties.$loading
//监听路由变化,变化就显示隐藏加载页面
// watch(getCurrentInstance()?.appContext.app.config.globalProperties.$loading, (newValue, oldValue) => {
//   console.log(`message changed from ${oldValue} to ${newValue}`)
//   // isloading.value = getCurrentInstance()?.appContext.app.config.globalProperties.$loading
//   console.log(isloading.value, 1231231231231);

// }, { deep: true })
localStorage.setItem('show', JSON.stringify({ show: true }))
//鼠标点击特效
import './utils/cursor-effects'
// import '@/utils/仙女棒.js'

// import '../public/live2dw/lib/l2d.js'
//@ts-ignore
// import { Paul_Pio } from '../public/live2dw/lib/pio.js'
// import '../public/live2dw/lib/pio.css'
// onMounted(() => {
//   var pio = new Paul_Pio({
//     "mode": "fixed",
//     "hidden": true,
//     "content": {
//       "welcome": ["欢迎来到DP的小宇宙！", "今天天气不错，一起来玩吧！", "博主每天都有些折腾记录，欢迎前往他的小窝阅读~"],
//       "custom": [
//         { "selector": ".comment-form", "text": "欢迎参与本文评论，别发小广告噢~" },
//         { "selector": ".home-social a:last-child", "text": "在这里可以了解博主的日常噢~" },
//         { "selector": ".post-item a", "type": "read" },
//         { "selector": ".post-content a, .page-content a", "type": "link" }
//       ]
//     },
//     "night": "single.night()",
//     "model": [import.meta.env.VITE_LIVE2D_PATH + "/LeiMu/model.json"]
//   });


// })


console.log('%c%s', 'color: rgb(241, 187, 58); font-size: 12px;', `......................我佛慈悲....................
                      _oo0oo_                     
                     o8888888o                    
                     88" . "88                    
                     (| -_- |)                    
                     0\\  =  /0                   
                   ___/‘---’\\___                 
                 .' \\|       |/ '.               
                / \\\\|||  :  |||// \\            
               / _||||| -卍-|||||_ \\             
              |   | \\\\\\  -  /// |   |          
              | \\_|  ''\\---/''  |_/ |           
              \\  .-\\__  '-'  ___/-. /           
            ___'. .'  /--.--\\  '. .'___          
         ."" ‘<  ‘.___\\_<|>_/___.’ >’ "".        
        | | :  ‘- \\‘.;‘\\ _ /’;.’/ - ’ : | |     
        \\  \\ ‘_.   \\_ __\\ /__ _/   .-’ /  /   
     =====‘-.____‘.___ \\_____/___.-’___.-’=====   
                      ‘=---=’                     
...................佛祖开光 ,永无BUG..............`)
</script>

<style scoped lang="scss">
.loading {
  opacity: 0.8;
  position: absolute;
  margin: auto;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;


}

.after::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, rgba(147, 112, 216, 0.9), rgb(0, 0, 0));
  z-index: 9998;
}
</style>